import request from '@/common/request/request.js'
import config from '@/common/config/config.js';
const http = config.env

// 看广告收益明细
export const viewVideoDetailInfo = () => {
	return request({
		url: http.baseUrl + '/advert/list',
		method: 'get',
	})
}
// 订单数量统计
export const orderTotal = () => {
	return request({
		url: http.baseUrl + '/order/findOrderCount',
		method: 'get',
	})
}
// 免责申明弹窗
export const openPopup = () => {
	return request({
		url: http.baseUrl + '/user/upPopUp',
		method: 'post',
	})
}

// 用户基础信息
export const customerInfo = () => {
	return request({
		url: http.baseUrl + '/user/personalCenter',
		method: 'POST',
	})
}

// 获取钱包流水
export const walletFlow = (data) => {
	return request({
		url: http.baseUrl + '/balance/balanceFlow',
		method: 'GET',
		data: data
	})
}

// 获取收货地址列表
export const receiveList = () => {
	return request({
		url: http.baseUrl + '/user/receiveList',
		method: 'GET',
	})
}

// 获取收货地址详情
export const receiveDetail = addressId => {
	return request({
		url: http.baseUrl + '/user/receiveDetail/' + addressId,
		method: 'GET',
	})
}

// 修改收货地址
export const updateReceive = data => {
	return request({
		url: http.baseUrl + '/user/updateReceive',
		method: 'PUT',
		data: data,
	})
}

// 删除收货地址
export const delReceive = addressId => {
	return request({
		url: http.baseUrl + '/user/delReceive/' + addressId,
		method: 'DELETE',
	})
}

// 新增收货地址
export const addReceive = data => {
	return request({
		url: http.baseUrl + '/user/addReceive',
		method: 'POST',
		data: data,
	})
}

// 获取钱包流水
export const FreezeFlow = (data) => {
	return request({
		url: http.baseUrl + '/freeze/freezeFlow',
		method: 'GET',
		data: data
	})
}






// 查询最近代发放奖金池
export const prizePool = data => {
	return request({
		url: http.baseUrl + '/team/prize/pool/month',
		method: 'GET',
		data: data
	})
}

// 查询往期记录
export const poolBeforeList = data => {
	return request({
		url: http.baseUrl + '/team/prize/pool/beforeList',
		method: 'GET',
		data: data
	})
}

// 历史排名记录
export const poolRanking = bunusId => {
	return request({
		url: http.baseUrl + '/team/prize/pool/ranking/' + bunusId,
		method: 'GET'
	})
}

// 激活账号
export const facilitatorActivate = data => {
	return request({
		url: http.baseUrl + '/customer/facilitatorActivate',
		method: 'POST',
		data: data
	})
}

// 查询用户待赠送积分
export const findBuyReleasedAmount = data => {
	return request({
		url: http.baseUrl + '/novaMate/findBuyReleasedAmount',
		method: 'GET',
		data: data
	})
}

// 查询用户待赠送积分列表
export const findBuyReleasedList = data => {
	return request({
		url: http.baseUrl + '/novaMate/findBuyReleasedList',
		method: 'GET',
		data: data
	})
}

// 忘记密码
export const forgetCipher = data => {
	return request({
		url: http.baseUrl + '/customer/forgetCipher',
		method: 'POST',
		data: data
	})
}

// 用户资产查询
export const customerAssets = data => {
	return request({
		url: http.baseUrl + '/customer/assets',
		method: 'POST',
		data: data
	})
}

// 获取手续费百分比
export const getServiceCharge = data => {
	return request({
		url: http.baseUrl + '/appConfig/configKey/asset.service.charge',
		method: 'get',
		data: data
	})
}

// 团队排行榜
export const teamRankingList = data => {
	return request({
		url: http.baseUrl + '/customer/teamRankingList',
		method: 'GET',
		data: data
	})
}

// 修改手机号码
export const changeAssetMobile = data => {
	return request({
		url: http.baseUrl + '/customer/changeAssetMobile',
		method: 'POST',
		data: data
	})
}
// 注销
export const loginOff = data => {
	return request({
		url: http.baseUrl + '/customer/logOff',
		method: 'GET',
		data: data
	})
}

// 积分转贡献值
export const pointsConvertAsset = data => {
	return request({
		url: http.baseUrl + '/customer/pointsConvertAsset',
		method: 'POST',
		data: data
	})
}

// 用户预消费查询
export const queryUserPreConsumption = data => {
	return request({
		url: http.baseUrl + '/customer/queryUserPreConsumption',
		method: 'POST',
		data: data
	})
}

// 用户贡献值查询
export const queryContributionByMobile = data => {
	return request({
		url: http.baseUrl + '/customer/queryContributionByMobile',
		method: 'POST',
		data: data
	})
}

// 余额互转
export const transfer = (data) => {
	return request({
		url: http.baseUrl + '/customer/transfer',
		method: 'GET',
		data: data
	})
}

// 获取钱包流水
export const getUserInfoByMobile = (data) => {
	return request({
		url: http.baseUrl + '/customer/findByMobile',
		method: 'GET',
		data: data
	})
}

// 购物积分过期总和
export const pointsExpiredTotal = (data) => {
	return request({
		url: http.baseUrl + '/customer/wallet/moneyCount',
		method: 'GET',
		data: data
	})
}

// 购物积分过期列表
export const pointsExpiredList = (data) => {
	return request({
		url: http.baseUrl + '/customer/wallet/listPage',
		method: 'GET',
		data: data
	})
}


// 获取互转流水统计
export const walletFlowTotal = (data, walletType) => {
	return request({
		url: http.baseUrl + '/customer/totalTransfer',
		method: 'GET',
		data: data
	})
}


// 获取个人业绩
export const personalPerformance = data => {
	return request({
		url: http.baseUrl + '/customer/personalPerformance',
		method: 'GET',
		data: data
	})
}

// 获取团队业绩
export const teamPerformance = data => {
	return request({
		url: http.baseUrl + '/customer/teamPerformance',
		method: 'GET',
		data: data
	})
}


// 用户钱包信息
export const wallet = () => {
	return request({
		url: http.baseUrl + '/customer/wallet',
		method: 'GET',
	})
}


// 获取业绩统计
export const getTeamTotal = data => {
	return request({
		url: http.baseUrl + '/order/my/teams/report/total',
		method: 'GET',
		data
	})
}

// 获取报表列表
export const getTeamTable = data => {
	return request({
		url: http.baseUrl + '/order/my/teams/order/list',
		method: 'GET',
		data
	})
}

// 查询团队平级奖
export const getTeamLateralList = data => {
	return request({
		url: http.baseUrl + '/teamLateral/findTeamLateralList',
		method: 'GET',
		data
	})
}
// 查询团队平级奖汇总
export const getTeamLateralTotal = data => {
	return request({
		url: http.baseUrl + '/teamLateral/totalConsumption',
		method: 'GET',
		data
	})
}


//获取下级用户
export const getUser = (data) => {
	return request({
		url: http.baseUrl + '/customer/other/get/user',
		method: 'GET',
		data
	})
}
//获取当前用户等级
export const userLevelType = (data) => {
	return request({
		url: http.baseUrl + '/customer/get/user/level/type',
		method: 'GET',
		data
	})
}

//积分不足告警
export const integralWarning = (data) => {
	return request({
		url: http.baseUrl + '/customer/integralWarning',
		method: 'GET',
		data
	})
}
